home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
cpusped.exe
/
CPU.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-30
|
1KB
|
60 lines
#if defined(__TURBOC__) /* Turbo C */
#if __STDC__
#define _Cdecl
#else
#define _Cdecl cdecl
#endif
#define _Near
#endif
int _Cdecl cpu(void);
void initializetimer(void);
long readtimer(void);
void restoretimer(void);
void elapsedtime(long start,long stop,double *result);
char *cpuspeed(unsigned char round,unsigned char cputype);
/*
==============================================================================
Determines the CPU type.
Example :-
int ctype;
ctype=cpu();
Type Table:
0 = Undetermined
1 = 8086/8088
2 = 8086/8088 with Coprocessor
3 = 80286
4 = 80286 with Coprocessor
5 = i386tm
6 = i386tm with 387 Coprocessor
7 = i386tm with 87/287 Coprocessor
8 = i486tm (SX)
9 = i486tm (DX) or i487tm (SX) with Coprocessor
==============================================================================
==============================================================================
Get CPU speed.
Example :-
void main(void)
{
clrscr();
cprintf("CPU speed is %s MHz\n\r",cpuspeed(1,CPU()));
}
arg1 = (int) 0 or 1, 1 = round result to whole value;
arg2 = (int) return result from CPU();
*/